From 817841a0c29b9fb0e011e113131ba256a957d6fa Mon Sep 17 00:00:00 2001 From: Daniel Cannon Date: Thu, 24 Apr 2008 18:50:40 +0000 Subject: [PATCH] Special:Shortpages should return pages from all content namespaces, not just NS_MAIN. --- RELEASE-NOTES | 1 + includes/SpecialShortpages.php | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index fcbcedf973..1e431ba2d2 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -90,6 +90,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN text from Special:UserLogin title (new message 'nav-login-createaccount') * Say "log in / create account" if an anonymous user can create an account, otherwise just "log in", consistently across skins +* Special:Shortpages returns pages in all content namespaces, not just NS_MAIN. === Bug fixes in 1.13 === diff --git a/includes/SpecialShortpages.php b/includes/SpecialShortpages.php index f375ecf2cc..bb2ef66937 100644 --- a/includes/SpecialShortpages.php +++ b/includes/SpecialShortpages.php @@ -27,18 +27,26 @@ class ShortPagesPage extends QueryPage { } function getSQL() { + global $wgContentNamespaces; + $dbr = wfGetDB( DB_SLAVE ); $page = $dbr->tableName( 'page' ); $name = $dbr->addQuotes( $this->getName() ); $forceindex = $dbr->useIndexClause("page_len"); + + if ($wgContentNamespaces) + $nsclause = "page_namespace IN (" . implode(',', $wgContentNamespaces) . ")"; + else + $nsclause = "page_namespace = " . NS_MAIN; + return "SELECT $name as type, page_namespace as namespace, page_title as title, page_len AS value FROM $page $forceindex - WHERE page_namespace=".NS_MAIN." AND page_is_redirect=0"; + WHERE $nsclause AND page_is_redirect=0"; } function preprocessResults( $db, $res ) { -- 2.20.1